package com.yunkeji.system.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yunkeji.dao.mapper.UserFeedbackMapper;
import com.yunkeji.dao.vo.UserFeedbackVo;
import com.yunkeji.system.domain.bo.UserFeedbackBo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface AdminUserFeedbackMapper extends UserFeedbackMapper {
    @Select(
        "<script>"
            + "SELECT u.platform_id,b.*,u.sex"
            + " FROM ykj_user_feedback b "
            + "left join ykj_app_user u on u.id=b.user_id "
            + "where 1=1"
            + "<if test='bo.type!=null'>"
            + "  and b.type = #{bo.type}"
            + "</if>"
            + "<if test='bo.status!=null'>"
            + "  and b.status=#{bo.status} "
            + "</if>"
            + "<if test='bo.platformId!=null'>"
            + "  and u.platform_id=#{bo.platformId} "
            + "</if>"
            + " order by create_time desc"
            + "</script>")
    Page<UserFeedbackVo> selectPageList(
        @Param("page") Page<UserFeedbackVo> page,
        @Param("bo") UserFeedbackBo build);
}
